<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div style="float:left;"><img src="{{'/'.$goods->goods_img}}" alt=""></div>
	<div>{{$goods->goods_name}}</div>
	<div>价格:{{$goods->goods_price}}</div>
	<form action="{{asset('cart/insert')}}" method="post">
		<div class="num" style="width:70px;height:20px;float:left;">
			<div class="Del" style="float:left;width:20px;height:20px;background:#369;text-align:center;">-</div>
			<input type="text" name="cart_num" value="1" style="display:inline-block;width:20px;height:10px;">
			<div class="Add" style="float:right;width:20px;height:20px;background:#369;text-align:center;">+</div>
		</div>
		<input type="hidden" name="goods_id" value="{{$goods->id}}">
		{{csrf_field()}};
		<button>加入购物车</button>
	</form>


	<script src="{{asset('HomeCss/dist/js/jquery-1.11.1.min.js')}}"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script src="{{asset('HomeCss/dist/js/bootstrap.min.js')}}"></script>
	<script  type="text/javascript">
	//详情页商品数量
	$('.Add').click(function(){
		var num = parseInt($('input[name=cart_num]').val());
		num = num+1;
		$('input[name=cart_num]').val(num);
	})
	$('.Del').click(function(){
		var num = parseInt($('input[name=cart_num]').val());
		num = num-1;
		if(num == 0){num=1;};
		$('input[name=cart_num]').val(num);
	})
	</script>
</body>
</html>